1. Field of the Invention
The present invention relates to a three-dimensional image generating apparatus which creates a three-dimensional model from a two-dimensional image by image processing with a computer to generate a three-dimensional image with computer graphics.
2. Description of the Related Art
Conventionally, a tool called xe2x80x9cpaintxe2x80x9d tool has been widely used as a basic drawing device of computer graphics. The paint tool makes it possible to input a graphic image with a feeling such that a user draws a picture on a display screen with a pen. In a drawing operation using the paint tool, two-dimensional coordinates are continuously specified by means of a pointing device such as a combination of a pen and tablet or a mouse, while coordinate changes accompanying the movement of the pointing device are continuously inputted. For example, in a case where the pointing device is provided with a brush attribution serving as a virtual drawing tool, when the pointing device is moved, drawing processing is carried out on a display with the motion of the pointing device as if a brush is moved.
With the use of the paint tool, it is possible to create an arbitrary image in such a manner that a designer freely draws a picture. In order to make more real an image drawn by computer graphics, it is desired that the image be made into an image which appears as a three-dimensional image. However, in order to draw the image having a three-dimensional appearance, considerably excellent skills, time and labor are required.
In order to solve the above-mentioned problems, there has been developed a computer graphics technique of subjecting a two-dimensional image to image processing so as to make it into a three-dimensional image, and displaying the three-dimensional image thus created. For example, there is a case where characters displayed. as a title of video (pictorial image) software or the like are displayed as a three-dimensional solid image. In order to display the three-dimensional character, a predetermined depth is added to a contour of a two-dimensional character so that the two-dimensional character is three-dimensionally expressed, and thereafter, a three-dimensional image is displayed by rendering. The depth may be nonuniform, for example, a contour portion of the character may be formed thinner than other portions of the character.
In a general technique of creating a three-dimensional model having a complicated shape, a surface of an object is divided into many polygons, for example, many triangles, and a final three-dimensional shape is determined according to a wire frame model which expresses a shape with the use of an edge composing of sides of respective triangles, and thus, a three-dimensional image is generated by rendering. In the case of adding a change to the complicated shape of the three-dimensional image, the wire frame model needs to be directly modified.
A technique for a title of video software or the like, which is one of conventional techniques of creating a three-dimensional model from a two-dimensional image, is directed to merely creating a three-dimensional model having a regular shape. Moreover, in order to directly modify a wire frame model to create a three-dimensional model, a considerable amount of special knowledge, time and labor are required.
An object of the invention is to provide a three-dimensional image generating apparatus capable of generating a three-dimensional image by incorporating elements of a two-dimensional image into elements of a three-dimensional model, and defining the three-dimensional model without carrying out complicated modeling.
Another object of the invention is to provide a three-dimensional image generating apparatus capable of generating three-dimensional images of various shapes on the basis of two-dimensional images drawn with the use of a paint tool.
The invention relates to a three-dimensional image generating apparatus which generates a three-dimensional image by rendering a three-dimensional model generated on the basis of a two-dimensional image. The apparatus comprises two-dimensional image storing means for storing a two-dimensional image, three-dimensional model setting means for setting a basic shape of the three-dimensional model onto which the two-dimensional image is to be reflected, and three-dimensional model generating means for generating the three-dimensional model by deforming the basic shape on the basis of the two-dimensional image stored in the two-dimensional image storing means according to a predetermined correspondence between an element of the two-dimensional image and a three-dimensional deformation of the basic shape of the three-dimensional model.
According to the invention, a three-dimensional image is generated by deforming the basic shape of the three-dimensional model on the basis of the element of the two-dimensional image stored in the two-dimensional image storing means, and subjecting the three-dimensional model which reflects the two-dimensional image to a rendering process.
In the invention, the two-dimensional image storing means stores image data which expresses the two-dimensional image inputted thereto. The three-dimensional model setting means sets modeling data which defines a three-dimensional shape which is a base for three-dimensionalizing the two-dimensional image.
The three-dimensional model generating means includes element extracting means for extracting information regarding a predetermined element from the inputted image data which expresses the two-dimensional image, and element transforming means for transforming the element information extracted by the element extracting means into three-dimensional information having a predetermined relation. The three-dimensional model generating means also includes model creating means for creating the three-dimensional model by incorporating the three-dimensional information transformed by the element transforming means into the modeling data set by the three-dimensional model setting means, and rendering means for rendering the three-dimensional model created by the model creating means into the three-dimensional image.
According to the invention, the two-dimensional image storing means stores the image data which expresses the two-dimensional image inputted thereto. The three-dimensional model setting means sets modeling data for defining a three-dimensional shape which is a base for making the two-dimensional image into three-dimensional. In the three-dimensional model generating means, the element extracting means extracts information on the predetermined element from the image data which expresses the inputted two-dimensional image.
The element transforming means transforms the element information extracted by the element extracting means into three-dimensional information having a predetermined correspondence therewith. The model creating means incorporates the three-dimensional information transformed by the element transforming means into the three-dimensional shape set by the three-dimensional model setting means to create a three-dimensional model. The rendering means subjects the three-dimensional model created by the model creating means to rendering so as to generate the model as a three-dimensional image. The three-dimensional image is generated on the basis of a three-dimensional model which reflects the element information extracted from the two-dimensional image. Therefore, by changing the element information of the two-dimensional image, it is possible to readily deform the generated three-dimensional image.
The three-dimensional model is created on the basis of the modeling data for determining the three-dimensional shape set by the three-dimensional model setting means. Therefore, there is no need of configuring the whole of the three-dimensional model on the basis of the element information extracted from the two-dimensional image, so that it is possible to reduce the required volume of image processing and to perform the image processing at a high speed.
Further, in the invention, the two-dimensional image is a monochrome image having three or more gradations. The element extracting means extracts gradation information as the element information from the image data which expresses the monochrome image, and the element transforming means transforms the gradation information into three-dimensional depth information.
According to the invention, the monochrome image having three or more gradations is inputted as the two-dimensional image, and the gradation information is extracted as the element information to be transformed into the three-dimensional depth information. Therefore, it is possible to transform gradations in a monochrome image into depth information which expresses a three-dimensional concave and convex. Thereby, it is further possible to readily produce shape data such as a wooden model of a wood-block print.
Further, in the invention, the two-dimensional image is a color image having a plurality of color components. The element extracting means extracts density information of a predetermined color component as the element information from image data which expresses the color image, and the element transforming means transforms the density information of the color component into three-dimensional depth information.
According to the invention, the color image having a plurality of color components is inputted as the two-dimensional image, and the density information of a predetermined color component is extracted as element information, and then, is transformed into the three-dimensional depth information. Therefore, it is possible to create a three-dimensional model which reflects a specific color component of the color image.
Further, in the invention, the three-dimensional image generating apparatus further comprises two-dimensional image modifying means which displays the image data which expresses the two-dimensional image stored in the two-dimensional image storing means inputting and allows input of an drawing operation for modifying the displayed image data.
According to the invention, when the image data which expresses the two-dimensional image is modified by the two-dimensional image modifying means, a three-dimensional model which reflects the modified two-dimensional image can be created. Therefore, it is possible to readily confirm the modified result by displaying the three-dimensional image generated by the rendering means, and to modify the two-dimensional image until a desired three-dimensional image is obtained.
Further, in the invention, the element extracting means, the element transforming means, the model creating means and the rendering means process only image data within a predetermined area including a pixel to which the drawing operation for modifying the image data is carried out by the two-dimensional image modifying means.
According to the invention, a modification of the two-dimensional image stored in the two-dimensional image storing means is performed on the image data within a predetermined area including a pixel to which a drawing operation for modifying the image data is carried out. Therefore, only image data within an area concerning the modification will be processed, so that it is possible to shorten a processing time as compared with the case where image processing of the whole image is performed.
Further, in the invention, the three-dimensional image generating apparatus further comprises mapping means for preparing mapping information which expresses a correspondence between a pixel on the three-dimensional image generated by rendering and a pixel on the two-dimensional image represented by the image data stored in the two-dimensional image storing means. In the processes of transforming the element information into the three-dimensional information by the element transforming means, the three-dimensional information is incorporated into the three-dimensional model by the model creating means, and the three-dimensional model is rendered by the rendering means. The three-dimensional image generating apparatus also comprises a rendering memory for storing three-dimensional data produced by the rendering means together with the mapping information prepared by the mapping means, three-dimensional image modifying means for allowing the three-dimensional image data stored in the rendering memory to be displayed and inputting a drawing operation for modifying the displayed data, and reverse mapping means for modifying the image data which expresses the two-dimensional image stored in the two-dimensional image storing means according to the mapping information stored in the rendering memory when the drawing operation is carried out on the three-dimensional image modifying means.
According to the invention, the rendering memory stores the three-dimensional image data generated by the rendering means, and the mapping information representative of a correspondence between each pixel on the three-dimensional image data and a pixel on the two-dimensional image. The image data stored in the rendering memory is modified by the three-dimensional image modifying means, and thereby, the modified content is incorporated into the corresponding two-dimensional image data. Thus, a three-dimensional model which is a rendering target is modified on the basis of the two-dimensional image. Then, even though the modification by the three-dimensional image modifying means is carried out with respect to the three-dimensional image generated by the rendering means, modification is carried out with respect to the image data which expresses the two-dimensional image which is a base for creating a three-dimensional model. Therefore, there is no need for directly modifying the three-dimensional model, and it is possible to carry out a three-dimensional modification by a simple modification on a two-dimensional image. Moreover, the two-dimensional image is modified, and the modified result is incorporated into the three-dimensional image. Therefore, it is possible to carry out modification on the three-dimensional image without mismatches between the modified portions and the periphery thereof.
Further, in the invention, the element extracting means, the element transforming means, the model creating means and the rendering means only process image data within a predetermined area including a pixel to which the drawing operation for modifying the image data is carried out by the three-dimensional image modifying means.
According to the invention, since a modification of the three-dimensional image generated by the rendering means is performed on the image data within a predetermined area including a pixel to which a drawing operation for modifying the image data is carried out. Therefore, only the image data within the area concerning modification will be processed, so that it is possible to shorten a processing time as compared with the case where image processing of the whole image is performed.
Further, in the invention, the three-dimensional image generating apparatus further comprises texture producing means for producing texture image data on the basis of the two-dimensional image from which the element information is extracted by the element extracting means, wherein the model creating means subjects a surface of the three-dimensional model which reflects the three-dimensional information, to texture mapping for the two-dimensional image according to texture coordinate data produced by the texture producing means.
According to the invention, the element information is extracted from the two-dimensional image by the element extracting means, and the extracted element information is incorporated into the three-dimensional model while texture coordinate data based on the two-dimensional image is produced by the texture producing means. Further, the rendering means carries out texture mapping on the basis of the texture coordinate data when the three-dimensional model is generated. Thus, the original two-dimensional image is three-dimensionalized, and it is possible to obtain a three-dimensional model which is partially deformed three-dimensionally.
Further, in the invention, the three-dimensional image generating apparatus further comprises bump storing means for storing bump processing data inputted thereto, wherein the model creating means subjects a surface of the three-dimensional model which reflects the three-dimensional information, to bump processing based on the data stored in the bump storing means.
According to the invention, the bumping data stored in the bump storing means is used for carrying out bumping processing when a three-dimensional model image is generated by the rendering means. Therefore, a deformation of a normal direction is made on the basis of the bumping data, and thereby, it is possible to readily add concave and convex shapes onto the surface of the three-dimensional image.
According to the invention, the information on the element extracted from the two-dimensional image is incorporated when creating the three-dimensional model, and a three-dimensional model having a complicated shape can be readily created. Also according to the invention, the shape serving as a base of the three-dimensional image is set with modeling data. Thereby, it is possible to generate the three-dimensional model which reflects the two-dimensional image.
According to the invention, it is possible to create a three-dimensional model which reflects the gradation of the monochrome image in the three-dimensional depth thereof. It is also possible to readily obtain a three-dimensional model in which a specific color component of the color image is incorporated into the depth information thereof. It is further possible to readily modify the three-dimensional model by modifying the image data of the two-dimensional image which is a base of the three-dimensional model.
According to the invention, a modification which is made to the three-dimensional image generated by rendering modification is incorporated into the original two-dimensional image. Therefore, the modification can be readily incorporated into the shape of the three-dimensional model without mismatches due to the modification. In the case where modification is carried out with respect to the image data, the image data within a predetermined area is modified by image processing, so that three-dimensional image processing can be promptly performed.
According to the invention, on the surface of the three-dimensional image which reflects the element extracted from the two-dimensional image, the two-dimensional image is added by texture mapping. Thereby, it is possible to obtain a three-dimensional image in which a part of the original two-dimensional image is made into concave and convex.
According to the invention, the surface of the three-dimensional image is subjected to bumping, so that the feel of material can be readily expressed.
In the invention, the two-dimensional image storing means has two-dimensional image drawing means provided with a brush tool for drawing the two-dimensional image, and stores a plurality of two-dimensional images including the two-dimensional image drawn by the two-dimensional image drawing means. Also, the three-dimensional model setting means sets a relation between a shape of the three-dimensional model and predetermined element information of the two-dimensional image. Further, the three-dimensional model generating means includes element extracting means for reading out the two-dimensional image stored in the two-dimensional image storing means, and extracting the element information related to the shape of the three-dimensional model from the two-dimensional image, and three-dimensional image processing means for creating the three-dimensional model whose shape reflects the element information of the two-dimensional image extracted by the element extracting means according to the relation set by the three-dimensional model setting means, and generating the three-dimensional image by rendering of the created three-dimensional model.
According to the invention, when the two-dimensional image is drawn by the brush tool included in the two-dimensional image drawing means, the two-dimensional image is stored in the two-dimensional image storing means. The two-dimensional image includes element information having a relation set by the three-dimensional model setting means with respect to the three-dimensional model. Element information is extracted from the two-dimensional image by the element extracting means, and then, is incorporated into a shape of the three-dimensional model by the three-dimensional image processing means so that a three-dimensional model is created, and thereafter, a three-dimensional image is generated by rendering. In other words, when the two-dimensional image is drawn, it is possible to generate a three-dimensional image having various shapes on the basis of the element information of the two-dimensional image.
Further, in the invention, the three-dimensional image generating apparatus further comprises image outputting means for outputting the three-dimensional image generated by the three-dimensional image processing means at a resolution higher than that of the displayed image.
According to the invention, the three-dimensional image generated by the three-dimensional image processing means can be outputted from the image outputting means at a resolution higher than that of a displayed image. Therefore, it is possible to output a three-dimensional image with an image quality as well as a photograph and printed matters.
Further, in the invention, the three-dimensional image generating apparatus further comprises reverse mapping means for generating and storing a correspondence of a pixel on the displayed three-dimensional image to a pixel on the two-dimensional image from which the element is extracted as reverse mapping information, when rendering is performed on the three-dimensional model which reflects the element information of the two-dimensional image by the three-dimensional image processing means. The three-dimensional image generating apparatus also comprises three-dimensional image modifying means for modifying the displayed three-dimensional image in accordance with a drawing operation on the two-dimensional image drawing means, and two-dimensional image modifying means for incorporating the modification made by the three-dimensional image modifying means into the two-dimensional image on the basis of the reverse mapping information stored in the reverse mapping means.
According to the invention, by the reverse mapping means, a correspondence of a pixel on the displayed three-dimensional image and a pixel on the two-dimensional image is generated and stored. Thus, when the three-dimensional image modifying means modifies the displayed three-dimensional image in accordance with a drawing operation made by the two-dimensional image drawing means, the two-dimensional image modifying means can reflect the modified content on the two-dimensional image on the basis of the reverse mapping information. Further, the modification content of the image displayed as the three-dimensional image is handled as an image modified foam the original two-dimensional image which modified image reflects the three-dimensional model element information Therefore, it is possible to modify a three-dimensional image with better reality while reducing mismatches on and in the vicinity of the modified portions.
Further, in the invention, the three-dimensional image generating apparatus further comprises processing area limiting means for controlling so that when the two-dimensional image from which the element extracting means extracts the element information or the displayed three-dimensional image is modified via the drawing operation made on the two-dimensional image drawing means, the processings of extracting the element information by the element extracting means and incorporating the element information into the three-dimensional model by the three-dimensional image processing means are effected in a limited predetermined shape area including a portion to be modified. Since, an area where modification is carried out is limited by the processing area limiting means, it is possible to shorten a response time required for the image modification, reduce a time lag between drawing operation and display, and thus, to promptly perform image processing.
Further, in the invention, the processing area limiting means controls so that the process for incorporation into the three-dimensional model is effected with respect to in the two-dimensional image corresponding to a pixel on the displayed three dimensional image within the predetermined area.
According to the invention, in the area where modification is carried out by being controlled by the processing area limiting means, only a pixel on the two-dimensional image corresponding to a pixel on the three-dimensional image displayed in the predetermined area is incorporated into the three-dimensional model. Therefore, it is possible to further shorten a response time between drawing and display, and to reduce a time lag.
Further, in the invention, the two-dimensional image drawing means, the two-dimensional image storing means, the three dimensional model setting means, the element extracting means and the three-dimensional image processing means are divided into a plurality of processing blocks beforehand, the processing blocks performing pipeline processing.
According to the invention, the processings from drawing of the two-dimensional image by the two-dimensional image drawing means to creation of the three-dimensional image by the three-dimensional image processing means are carried out according to pipeline processing while being divided into a plurality of processing blocks. Therefore, each block processing is effectively performed, and it is possible to promptly perform a three-dimensional image generation with respect to a continuous drawing operation.
Further, in the invention, the two-dimensional image drawing means is provided with a pointing device capable of inputting two-dimensional coordinates and information of pen pressure for operating the brush tool. According to the invention, when the pointing device is operated by the two-dimensional image drawing means, the two-dimensional coordinates and the pen pressure are inputted. Therefore, it is possible to draw the two-dimensional image with a feeling such that a user is drawing with a pen or brush.
Further, in the invention, a shape of the brush tool of the two-dimensional image drawing means is changeable. According to the invention, in the brush tool of the two-dimensional image drawing means, the brush shape is changeable. Therefore, it is possible to flexibly perform different representations with the use of various brushes.
Further, in the invention, the three-dimensional image processing means erases portions where the element information of the two-dimensional image is not incorporated into the shape of the three-dimensional model to be generated while leaving the portions which reflect the two-dimensional image. The three-dimensional image processing means for creating the three-dimensional model erases portions of the shape of the three-dimensional model to be generated which portions do not reflect the element information of the two-dimensional image, while leaving the portions of the shape which reflect the two-dimensional image. Therefore, an advantage that only the element information extracted from the two-dimensional image is displayed with three-dimensional effect.
Further, in the invention, the three-dimensional image processing means incorporates the element information of the two-dimensional image into the shape of the three-dimensional model in both of retracting and protruding directions thereof. The three-dimensional image processing means incorporates element information of the two-dimensional image into the element information on the three-dimensional model in both of the retracting and protruding directions thereof. Therefore, it is possible to three-dimensionally display the element information of the original two-dimensional image with a representation such that a fluid such as a paint is squeezed from a paint tube.
Further, in the invention, the three-dimensional model setting means is provided with three-dimensional coordinates storing means for storing coordinate information which defines the three-dimensional basic shape having a surface on which the two-dimensional image is to be reflected, and a relation between the coordinate information stored in the three-dimensional coordinate storing means and the element information is set. The three-dimensional coordinate storing means stores the coordinate information for defining a shape which is a base of the three-dimensional model. Therefore, it is possible to define a shape of the three-dimensional model independently from the two-dimensional image drawn by the two-dimensional image drawing means, and incorporate the two-dimensional image into various shapes by three-dimensional image processing, and thus, to obtain various three-dimensional images.
The invention provides a recording medium readable by a computer, on which a program for causing the computer to function as a three-dimensional image generating apparatus is recorded, the three-dimensional image generating apparatus subjecting a three-dimensional model generated on the basis of a two-dimensional image to rendering so as to generate a three-dimensional image. The three-dimensional image generating apparatus comprising two-dimensional image storing means for storing the two-dimensional image, three-dimensional model setting means for setting a basic shape of the three-dimensional model on which the two-dimensional image is to be reflected, and three-dimensional model generating means for generating the three-dimensional model by deforming the basic shape on the basis of the two-dimensional image stored in the two-dimensional image storing means according to a predetermined correspondence between an element of the two-dimensional image and a three-dimensional deformation of the basic shape of the three-dimensional model.
According to the invention, it is possible to operate a computer as the three-dimensional image generating apparatus which generates a three-dimensional model in which element information of a two-dimensional drawn image is incorporated into the three-dimensional shape, and performs rendering on the three-dimensional model to generate a three-dimensional image. The two-dimensional image is drawn with the use of the brush tool, and thereby, it is possible to generate a three-dimensional image which reflects the element information of the two-dimensional image. The generated three-dimensional image is arbitrarily modified according to the correspondence between the three-dimensional model and the predetermined element information of the two-dimensional image, so that various representations can be performed. Further, the generated three-dimensional image is displayed, so that the drawing result based on the two-dimensional image can be confirmed.
According to the invention, the generated three-dimensional image is outputted by the image output means at a resolution higher than that of the displayed image, so that a three-dimensional image having a high image quality can be outputted.
According to the invention, when a modification is made on the displayed image by the two-dimensional image drawing means, a corresponding portion of the two-dimensional image whose element is incorporated into the shape of the three-dimensional model is modified on the basis of the reverse mapping information. Therefore, it is possible to make natural image modification on and in the vicinity of the portion in question while looking at the display of the three-dimensional image.
According to the invention, in the case of modifying the image, the modification is carried out within the predetermined area including the portion to be modified, and thereby, it is possible to shorten a time from the drawing operation is made for the modification to the modification result is displayed, and to improve the response.
According to the invention, when a modification is carried out with respect to the displayed image, the modification is carried out with respect to a pixel of the two-dimensional image corresponding to the displayed image. Therefore, even in the case where the two-dimensional and three-dimensional images have a resolution higher than that of the displayed image, the number of pixels to be subjected to the modification is limited, and it is possible to promptly confirm the modification result by displaying the image.
According to the invention, it is possible to shorten a time required for image processing by applying the pipeline operation, and to shorten a time from the drawing operation to the generation of the three-dimensional image which reflects the drawing information.
According to the invention, by the two-dimensional image drawing means, a pen pressure is inputted in addition to the two-dimensional coordinates with the use of the pointing device such as a mouse and a tablet system. It is, therefore, possible to draw a two-dimensional image having gradations with various representations.
According to the invention, in the brush tool of the two-dimensional image drawing means, the brush shape is changeable. Therefore, it is possible to arbitrarily set a diameter of the brush, and to change shape data indicative of a density distribution in the brush. Whereby various and flexibly representations can be performed.
According to the invention, only two-dimensional image drawn by the brush tool is made solid, and thus, a three-dimensional image can be generated. Only a two-dimensional image drawn by the brush tool can generate a three-dimensional image having a shape as being squeezed from a paint tube.
According to the invention, it is possible to define the three-dimensional model independently from the two-dimensional image, and to obtain a three-dimensional image which reflects the element information extracted from the two-dimensional image on the basis of the model.
According to the invention, it is possible to operate the computer system as a three-dimensional image processing apparatus which draws the two-dimensional image by the paint tool, which two-dimensional image is to be reflected on the three-dimensional shape.